package com.example.demo.executor.backupDeal;

/**
 * 备份表数据处理策略枚举
 * @author 又菜又爱浪
 */
public enum BackupDealEnum {

    DEFAULT("default"),

    ;

    private String dealStrategy;

    BackupDealEnum (String dealStrategy){
        this.dealStrategy = dealStrategy;
    }

    public String getDealStrategy() {
        return dealStrategy;
    }

    public void setDealStrategy(String dealStrategy) {
        this.dealStrategy = dealStrategy;
    }

    public static String getBackupDealType(String dealStrategy){
        for(BackupDealEnum dealEnum : BackupDealEnum.values()){
            if(dealEnum.getDealStrategy().equals(dealStrategy)){
                return dealEnum.getDealStrategy();
            }
        }
        return DEFAULT.getDealStrategy();
    }
}
